﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace IslandInterloper.Engine
{
    internal class IslandCommodities:GameClientCollectionStringKeyed<IslandCommodity>
    {
        internal IslandCommodities(Game theGame):
            base(theGame)
        {
            foreach (string commodity in Game.Commodities.Keys)
            {
                if (Game.Commodities[commodity].Traded)
                {
                    collection.Add(commodity, new IslandCommodity(Game, commodity));
                }
            }
        }
        internal IslandCommodities(Game theGame, XElement element)
            : base(theGame,element)
        {
        }
        protected override IslandCommodity LoadItemFromXElement(XElement element)
        {
            return new IslandCommodity(Game, element);
        }
    }
}
